# -*- coding: utf-8 -*-
# @Time    : 2024/8/30 下午2:27
# @Author  : wb
# @Email   : wb@163.com
# @File    : client_page
# @Software: PyCharm

from time import sleep
from pages.wb_base_page import BasePage
from selenium.webdriver.common.by import By


class ClientAddPage(BasePage):
    url = '/crm'
    # 定位器
    '''获取客户名称元素'''
    client_name_locator = (By.NAME, 'name')
    '''获取保存按钮元素'''
    save_btn_locator = (By.CSS_SELECTOR, '#form1 > table > tfoot > tr > td > input:nth-child(1)')




    # 浏览器操作
    def input_add_client_name(self,client_name):
        # 输入客户名称
        self.driver.find_element(*self.client_name_locator).send_keys(client_name)
    def click_add_save(self):
        # 点击保存
        self.driver.find_element(*self.save_btn_locator).click()
        sleep(3)
